<?php
header("content-type:text/html;charset=utf-8");
include "../config/mysql.php";
session_start();
if(isset($_SESSION['username'])){
  $id=$_POST["id"];
  $username=$_POST["username"];
  $email=$_POST["email"];
  $password=$_POST["password"];
  $phone=$_POST["phone"];
  $date=$_POST["date"];
  $regtime=strtotime($date);               
     $tr=$pdo->exec("update user set username='$username',email='$email',password='$password',phone='$phone',regtime='$regtime' where id=$id");
     
                 if($tr){
                 	header("refresh:1;url=../index.php");
                 	print("修改成功,请稍后..<br>");
                 }
                 else{
                 	header("refresh:3;url=../useredit2.php?id=$id");
                 	print("修改失败,可能是未修改原因造成的,请稍后..<br>");
                 }


}else{
  header("Location:../log.php");
      exit();
}
?>